import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { ConfigProvider, Dropdown } from 'antd-v4';
import { useContext } from 'react';
import Footer from '../DropdownFooter';
import './index.less';

var FilterDropdown = function FilterDropdown(props) {
  var children = props.children,
      label = props.label,
      footer = props.footer,
      disabled = props.disabled,
      onVisibleChange = props.onVisibleChange,
      visible = props.visible,
      footerRender = props.footerRender,
      placement = props.placement;

  var _useContext = useContext(ConfigProvider.ConfigContext),
      getPrefixCls = _useContext.getPrefixCls;

  var prefixCls = getPrefixCls('pro-core-field-dropdown');
  return _jsx(Dropdown, {
    disabled: disabled,
    placement: placement,
    trigger: ['click'],
    visible: visible,
    onVisibleChange: onVisibleChange,
    overlay: _jsxs("div", {
      className: "".concat(prefixCls, "-overlay"),
      children: [_jsx("div", {
        className: "".concat(prefixCls, "-content"),
        children: children
      }), footer && _jsx(Footer, _objectSpread({
        disabled: disabled,
        footerRender: footerRender
      }, footer))]
    }),
    children: _jsx("span", {
      className: "".concat(prefixCls, "-label"),
      children: label
    })
  });
};

export default FilterDropdown;